<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java"%>
<%@ include file="/page/common/taglibs.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>测试</title>
<script type="text/javascript">

</script>
</head>
<body>
<div style="text-align:right;">
<a href="<c:url value="/j_acegi_logout"/>">退出</a>
</div>
<authz:authorize ifAnyGranted="AUTH_TEST_QUERY">
<s:form action="/test/findPageTest.do" >
<table  width="25%" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC" >
	<tr align="center" height="30"  >
		<td colspan="2">查询</td>
	</tr>
		<s:hidden name="pageNoPara" value="1"></s:hidden>
		<s:hidden name="operateQuery" value="query"></s:hidden>
		<s:textfield name="testDTO.value" id="value" label="value"/>
		<s:submit value="查询" align="center"></s:submit>
</table>
</s:form>
</authz:authorize>
<p></p><p></p>
<div style="text-align:right; margin-right:200px;">
<authz:authorize ifAnyGranted="AUTH_TEST_NEW">
<input type="button" value="新增" onclick="javascript:document.location.href='/${ctx}/test/addPageTest.do'" /> 
</authz:authorize>
</div>
<s:if test="message!=null">
<div style="text-align:left; margin-left:200px;color: red;"><s:property value="message" /></div>
</s:if>
<table  width="60%" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC" >
	<tr>
		<td align="center">id</td>
		<td align="center">value</td>
		<authz:authorize ifAnyGranted="AUTH_TEST_UPDATE">
			<td></td>
		</authz:authorize>
		<authz:authorize ifAnyGranted="AUTH_TEST_DELETE">
			<td></td>
		</authz:authorize>
	</tr>
	<s:if test="totalCount gt 0">
	<s:iterator value="testDTOList" var="test">
		<tr height="10" align="center" valign="middle" bgcolor="#FFFFFF">
			<td align="center"><s:property value="id" /></td>
			<td align="center"><s:property value="value" /> </td>

		<authz:authorize ifAnyGranted="AUTH_TEST_UPDATE">
			<td><a href="/${ctx}/test/updatePageTest.do?id=<s:property value="id" />&pageNoPara=<s:property value="pageNo"/>" >更新</a></td>
		</authz:authorize>
		<authz:authorize ifAnyGranted="AUTH_TEST_DELETE">
			<td><a href="/${ctx}/test/deleteTest.do?id=<s:property value="id"/>&pageNoPara=<s:property value="pageNo"/>" >删除</a></td>
		</authz:authorize>
		</tr>
	</s:iterator>
	</s:if>
	<s:else>
		<tr bgcolor="#FFFFFF">
			<td colspan="4" align="center">无记录</td>
		</tr>
	</s:else>
<s:form action="/test/findPageTest.do" theme="simple"> 
<s:hidden name="operateQuery" value="go"></s:hidden>
	<tr>
		<td align="right" colspan="4">
			总记录数：<s:property value="totalCount"/>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<s:property value="pageNo"/>&nbsp;/&nbsp;<s:property value="totalPageCount"/>
			&nbsp;&nbsp;&nbsp;&nbsp;
			<s:url id="url_pre" value="/test/findPageTest.do">   
		         <s:param name="pageNoPara" value="pageNo-1"></s:param>
				 <s:param name="testDTO.value" value="testDTO.value"></s:param>   
		     </s:url>   
		  
		     <s:url id="url_next" value="/test/findPageTest.do">   
		         <s:param name="pageNoPara" value="pageNo+1"></s:param>
				 <s:param name="testDTO.value" value="testDTO.value"></s:param>   
		     </s:url>     
		  
		     <s:a href="%{url_pre}">上一页</s:a>   
		  	
		     <s:a href="%{url_next}">下一页</s:a>
			
			 <input type="text" size="3" maxlength="3" name="pageNoPara" id="pageNoPara">&nbsp;
			 <s:submit value="go" theme="simple"></s:submit>
	    </td>
	</tr>
</s:form>
</table>
</body>
</html>